<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'media-form',
	'enableAjaxValidation'=>true,
	'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>

	<?php echo Yii::t('admin','<p class="note">Fields with <span class="required">*</span> are required.</p>');?>	

	<?php echo $form->errorSummary($model); ?>
	<div class="one-third right" style="margin:0px;">
		<div class="row">
			<?php echo $form->labelEx($model,'media_name'); ?>
			<?php echo $form->textField($model,'media_name',array('size'=>60,'maxlength'=>200)); ?>
			<?php echo $form->error($model,'media_name'); ?>
		</div>	
		<div class="row">
			<?php echo $form->labelEx($model,'media_cid'); ?>
				<?php echo $form->dropDownList($model,'media_cid', Category::model()->getCategoryDropdownList(Category::CATEGORY_MEDIA),array(
		                   	'title'=>'选择分类'
		         )); ?>
			<?php echo $form->error($model,'media_cid'); ?>
		</div>
		

		<div class="row">
			<?php echo $form->labelEx($model,'media_recommend'); ?>
			<?php echo $form->dropDownList($model,'media_recommend',Media::model()->generateRecommendStateDropdownList()); ?>
			<?php echo $form->error($model,'media_recommend'); ?>
		</div>
		<div class="row>
		<?php echo $form->labelEx($model,'media_iscomment'); ?>
		<?php echo $form->dropDownList($model,'media_iscomment',Media::model()->generateCommentStateDropdownList()); ?>
		<?php echo $form->error($model,'media_iscomment'); ?>
		</div>
	
		<div class="row">
			<?php echo $form->labelEx($model,'media_status'); ?>
			<?php echo $form->dropDownList($model,'media_status',Media::model()->generateStatusStateDropdownList()); ?>
			<?php echo $form->error($model,'media_status'); ?>
		</div>	
	
		<div class="row">
			<?php echo $form->labelEx($model,'media_describe'); ?>
			<?php echo $form->textArea($model,'media_describe',array('rows'=>6, 'cols'=>50)); ?>
			<?php echo $form->error($model,'media_describe'); ?>
		</div>
	
		<div class="row">
			<hr />
			<hr />
			<hr/>
			<button class="cupid-green"  type="submit"  id="arc_submit"><?php echo $model->isNewRecord?'提交':'更新';?></button>
			<hr />
			<hr />
			<?php echo $form->errorSummary($model); ?> 
		</div>
		<hr class="space" />
		<div class="note">
			<ol>
				此处有以下问题存在：
				<li>增加相片时，上传虽然能正常进行，但却不能正常显示进度</li>
				<li>相片上传过后，可能需要强制刷新才能退出</li>
			</ol>
		</div>
	</div>
	<div style="margin-top:0px;min-width:50%;">
		<div class="row" style="text-align:center;">
			
			<?php if($model->media_pic_id):?>
				<img alt="folder" id="media_pic_id" src="<?php echo File::model()->generateFilePath(File::model()->findByPk($model->media_pic_id, $params),0)?>">
			<?php else:?>
				<img alt="folder" id="media_pic_id" src="/public/images/folder.png" width="200";>
			<?php endif;?>
			<br />
			<?php if($model->media_pic_id):?>
				<a href="#" class="various1" title="上传产品样图">继续增加产品样图</a>
			<?php elseif ($model->media_id):?>
				该产品还未增加产品样图，<a href="#" class="various1" title="上传产品样图">现在增加</a>
			<?php else:?>
				信息增加完成后，增加产品样图，并设置封面。			
			<?php endif;?>	
		</div>	
	</div>
	


<?php $this->endWidget(); ?>

</div><!-- form -->